import {request} from '@/utils/request'

export async function getRoles(data){
  return request('api/roles','get',data)
}

export async function getRole(id){
    return request(`api/roles/${id}`,'get')
}

export async function delRole(id){
    return request(`api/roles/${id}`,'delete')
}

export async function updataRole(data){
    return request(`api/roles/${data.id}`,'put',data)
}

export async function addRole(data){
    return request('api/roles','post',data)
  }

export default {
    getRoles,
    updataRole,
    delRole,
    addRole,
    getRole
}
